package com.javasm.transfer;

import com.javasm.domin.entity.SaleOutDepot;
import com.javasm.domin.vo.SaleOutDepotVo;
import com.javasm.transfer.base.BaseTransfer;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author：马明通
 * @Version：1.0
 * @Date：2022/1/18-15:16
 * @Since:jdk1.8
 * @Description:
 */
@Component
@RequiredArgsConstructor
public class SaleOutDepotTransfer extends BaseTransfer<SaleOutDepot,SaleOutDepotVo> {

    public List<SaleOutDepotVo> setSodStatus(List<SaleOutDepot> saleOutDepots){
        List<SaleOutDepotVo> saleOutDepotVos = super.toVO(saleOutDepots);
        for (int i = 0; i < saleOutDepotVos.size(); i++) {
            SaleOutDepot saleOutDepot = saleOutDepots.get(i);
            SaleOutDepotVo saleOutDepotVo = saleOutDepotVos.get(i);
            if (saleOutDepot.getSodStatus() == 1){
                saleOutDepotVo.setSodStatus("已出库");
            }
            if (saleOutDepot.getSodStatus() == 0){
                saleOutDepotVo.setSodStatus("待出库");
            }
        }
        return saleOutDepotVos;
    }
}
